from django.contrib.auth.password_validation import MinimumLengthValidator
from django.utils.translation import gettext as _

class CustomMinimumLengthValidator(MinimumLengthValidator):
    def __init__(self, min_length=8):
        super().__init__(min_length)
        self.message = _("您的密码必须至少包含 %(min_length)d 个字符。") % {'min_length': min_length}
